from django.db import models
from spango.spip.models import Article, Breve, Rubrique

class TypeDocument(models.Model):
    id_type = models.IntegerField(primary_key=True)
    titre = models.TextField()
    descriptif = models.TextField()
    extension = models.CharField(unique=True, max_length=30)
    mime_type = models.CharField(max_length=300)
    inclus = models.CharField(max_length=15)
    upload = models.CharField(max_length=9)
    maj = models.DateTimeField()
    class Meta:
        db_table = u'spip_types_documents'

class Document(models.Model):
    id_document = models.IntegerField(primary_key=True)
    id_vignette = models.IntegerField()
    id_type = models.IntegerField()
    titre = models.TextField()
    date = models.DateTimeField()
    descriptif = models.TextField()
    fichier = models.CharField(max_length=765)
    taille = models.IntegerField()
    largeur = models.IntegerField()
    hauteur = models.IntegerField()
    mode = models.CharField(max_length=24)
    distant = models.CharField(max_length=9, blank=True)
    idx = models.CharField(max_length=9)
    maj = models.DateTimeField()
    class Meta:
        db_table = u'spip_documents'

class DocumentArticle(models.Model):
    id_document = models.IntegerField()
    id_article = models.IntegerField(primary_key=True)
    class Meta:
        db_table = u'spip_documents_articles'

class DocumentBreve(models.Model):
    id_document = models.IntegerField()
    id_breve = models.IntegerField(primary_key=True)
    class Meta:
        db_table = u'spip_documents_breves'

class DocumentRubrique(models.Model):
    id_document = models.IntegerField()
    id_rubrique = models.IntegerField(primary_key=True)
    class Meta:
        db_table = u'spip_documents_rubriques'
